<?
#include "Database.class.php";
#include "Grid.class.php";

class GridDataSource{


	public static function Fill($grid, $sql){	
		$array = DataBase::ExecuteQuery($sql);
		$header = DataBase::FieldsName($sql);
		array_push($grid->grid, $header);
		
		foreach($array as $row)
			array_push($grid->grid, $row);

	}#filling
	
	
	

}
#$sql = "SELECT * FROM reservaciones WHERE fecha between '20080101' AND '20080130'";
#$grid = new Grid();
#GridDataSource::Fill($grid, $sql);
#$grid->walk();

#$names = GridDataSource::FieldsName($sql);
#implode(",",$names);
?>